<template>
  <div class="allfull">
    <!-- <img class="left_top" src="../assets/img/left-top.png" alt="">
    <img class="left_bottom" src="../assets/img/left-bottom.png" alt="">
    <img class="right_top" src="../assets/img/right-top.png" alt="">
    <img class="right_bottom" src="../assets/img/right-bottom.png" alt=""> -->
    <div class="content">
      <div class="tab">
        <div class="list">
          <p v-for="(item, index) in tabs" :key="index" :class="{'active': index === activeIndex}" @click="choose(item,index)">
            <span v-if="index === 0" class="shape-left"></span>
            <span class="test">{{item.label}}</span>
          </p>
        </div>
      </div>
      <router-view/>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      activeIndex: 0,
      tabs: [
        {
          label:'设备状态',
          href:'runState'
        },
        {
          label:'故障分析',
          href:'failure'
        }
      ]
    };
  },
  mounted(){
    var message4 = {
      "clientId": "jrzlss_system",
      "sourceId": "jrzlss_system",
      "targetId": "xj_platform",
      "messageType": "initApp",
      "params": {
            "screenIndex": 4,
            "finished": true,
            "message": "加载完成"
        }
    };
    window.parent.postMessage(message4,'*')

    console.log('发送了message4 = ', message4)
  },
  methods: {
    choose(item,index) {
      this.activeIndex = index
      this.$router.push({name:item.href})
    },
  }
}
</script>
<style  lang="less" scoped>
.allfull{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  .left_top{
    position: absolute;
    left: 2px;
    top: 2px;
    width: 100px;
    height: 100px;
  }
  .left_bottom{
    position: absolute;
    left: 2px;
    bottom: 2px;
    width: 100px;
    height: 100px;
  }
  .right_top{
    position: absolute;
    right: 2px;
    top: 2px;
    width: 100px;
    height: 100px;
  }
  .right_bottom{
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 100px;
    height: 100px;
  }
  .content{
    position: absolute;
    z-index: 1;
    left: 6px;
    top: 11px;
    right: 7px;
    bottom: 12px;
    background: #0d1830;
    -webkit-box-shadow:0px 5px 12px rgba(141, 207, 248, 0.5) inset;
    -moz-box-shadow:0px 5px 12px rgba(141, 207, 248, 0.5) inset;
    box-shadow:0px 5px 12px rgba(141, 207, 248, 0.5) inset;
    padding-top: 60px;
    .tab{
      width: 100%;
      height: 40px;
      display: flex;
      padding-top: 10px;
      border-bottom: 1px solid #164C7E;
      justify-content: space-between;
      position: absolute;
      top: 0;
      left: 0;
      margin: 0 15px;
      overflow: hidden;
      .list{
        display: flex;
        margin-left: -29px;
        p{
          width: 120px;
          height: 30px;
          line-height: 30px;
          margin-left: 10px;
          // background: #164C7E;
          border: 1px solid #164C7E;
          font-size: 14px;
          color: #5273E0;
          text-align: center;
          cursor: pointer;
          border-radius: 3px;
          transform: skewX(50deg);
          position: relative;
          &:nth-child(1){
            .test{
              position: absolute;
              left: 40px;
              top: 0;
              font-size: 14px;
            }
          }
          span{
            display: block;
            transform: skewX(-50deg);
          }
          .shape-left{
            display: inline-block;
            width: 37px;
            height: 32px;
            background: #0d1830;
            position: relative;
            top: -1px;
            left: -58px;
            z-index: 1;
            border-right: 1px solid #164C7E;
          }
          &:hover,&:active,&.active{
            color: #06CBFF;
          }
        }
      }
      .full{
        padding-right: 10px;
        img{
          width: 30px;
          height: 30px;
        }

      }
    }
  }
}
</style>

